Introduction
There are plenty of things we can
change. And then, there are many we
can't.
Let's talk about the second
ones.
Earth spins in ~24 hours - we can't
change it.
If you throw a rock, it'll fall to
ground - there's no way around
that.
Engines need power to run - at least
for now, we can't make 'em run without
it.
And computers ? They use constants all
the time, although it looks like you
can never catch their tail. Not only
these silly machines can't work
without constant power input (and
constant voltage), but software part
also enjoys using constant data
values.
And constant data values are not only
letters and numbers - they are
represented with certain labels, used
as value descriptors. Like
postcards have addresses of their
recepients...
...constants in software are also
labeled, making it easy to determine
what kind of data is assigned to which
constants.
Data put into constants is not meant
to be directly changed by your
program.
Let's say the glass on images above
represents constant label
(container).
Water in glass is constant.
It's not changing in time.
Constants in MMB are used:
-
for various multimedia
& system info, like screen
size, audio & video duration,
windows & project folder
paths, media titles, etc.
-
as command parameters
when you want to say something
special to MMB (like: please open
this in new window, please put
this on top, please make some more
coffee)
And guess what - some constants can be
changed, but indirectly - if you
change played audio or video file,
it's expected to affect duration &
title constants. But MMB performs
changes to constants automatically -
so you don't have to worry about 'em
at all.
Important feature of MMB's constants
is ability to retrieve their values
into string and numerical variables.
This enables wide range of operations
over retrieved info.
To copy constant info to numerical
variable, you'll start by:
a) writing label of numerical
variable:
CurrentYear
b) followed by equal sign:
=
c) and writing constant you want info
from:
CBK_Year
All together, MMB code line for
retrieving current year from CBK_Year
constant to numerical variable
CurrentYear looks like this:
CurrentYear=CBK_Year
To copy constant info to string
variable, you'll start by:
a) writing label of string
variable:
WindowsVer$
b) followed by equal sign:
=
c) and writing constant you want info
from:
WinVer()
MMB code line for retrieving of
Windows version from WinVer() constant
to string variable WindowsVer$ looks
like this:
WindowsVer$=WinVer()
As visible from examples above, some
constants return numerical values and
some return string values (depends on
info they contain).
CBK Constants
They sound so scary and ugly (CBK !),
but they are nothing more than just a
Multimedia & System info constants
that can be displayed in text objects,
like all multimedia players do
!
Ha ! Who would guess it ;-)
CBK type of constant is a property of
MMB's Text Object. So let's go
there and see what can we find,
change, learn:
Next to the "Label" property of text
object, there's an arrow button. Click
on it opens a menu with list of CBK
constants that can be used in your
project. They're separated into 6
categories, depending on their info
coverage. After setting CBK constant,
text object you assigned it to will in
runtime mode (when application runs)
display info from that constant.
Explanations of all CBK's coming
up.
Audio CBK constants
CBK name
|
Explanation
|
Example
|
CBK_Total
|
Displays total
(duration) time of
currently loaded audio
file. Format of displayed
time is mm:ss
(minutes:seconds)
|
21:12
|
CBK_Total
Sec
|
Displays total
(duration) time of
currently loaded audio
file.
Time is displayed in
seconds.
|
360
|
CBK_Time
|
Displays current
time (position) of
loaded audio file.
Format of displayed time
is mm:ss
(minutes:seconds)
|
11:08
|
CBK_Time
Sec
|
Displays current
time (position) of
loaded audio file.
Time is displayed in
seconds.
|
110
|
CBK_MP3Type
|
Returns type of
loaded MP3 file.
|
MPEG 1 Layer 3
|
CBK_MP3Bit
|
Returns bitrate of loaded
audio file. Bitrate
format:
kbit/s
|
128kbps
|
CBK_MP3Freq
|
Returns sampling
frequency of loaded
audio file. Frequency is
expressed in kHz (n x
1000Hz)
|
44.1kHz
|
CBK_MP3Name
|
Returns name of
loaded audio file, without
path and extension.
|
Barry White - Baby
Blues
|
CBK_Channels
|
Returns audio file channel
mode.
Can be either Mono
or Stereo.
|
Stereo
|
CBK_ID3Song
|
Displays title of
MP3 audio file retrieved
from ID3 tag.
|
Baby Blues
|
CBK_ID3Artist
|
Displays artist of
MP3 audio file retrieved
from ID3 tag.
|
Barry White
|
CBK_ID3Album
|
Displays album of MP3
audio file retrieved from ID3
tag.
|
The Ultimate
Collection
|
CBK_ID3Year
|
Displays year of MP3
audio file retrieved from ID3
tag.
|
2000.
|
CBK_ID3Genre
|
Displays genre of MP3
audio file retrieved from ID3
tag.
|
Soul
|
CBK_NumTracks
|
Returns number of Audio CD
tracks.
|
12
|
Song List CBK constants
CBK name
|
Explanation
|
Example
|
CBK_CurItemList
|
Displays item currently
selected in the song
list.
|
Delirium - After
All
|
CBK_NumInList
|
Counts and displays number
of items in song
list.
|
31
|
|
Counts and displays
total duration of
all items in song
list.
Format of displayed time
is mm:ss
(minutes:seconds).
You
will have to use SongListTime()
function to
compute CBK_TotalList.
|
135:28
|
|
Counts and displays
total duration of
all items in song
list.
Time is displayed in
seconds.
You
will have to use SongListTime()
function to
compute CBK_TotalListSec.
|
1130
|
Video CBK constants
CBK name
|
Explanation
|
Example
|
CBK_VName
|
Returns name of
playing video file,
without path and
extension.
|
TheMatrix
|
CBK_VTotal
|
Displays total
(duration) time of
currently playing video
file. Format of displayed
time is mm:ss
(minutes:seconds)
|
180:00
|
CBK_VTotalSec
|
Displays total
(duration) time of
currently playing video
file.
Time is displayed in
seconds.
|
10800
|
CBK_VTime
|
Displays current
time (position) of
playing video file.
Format of displayed time
is mm:ss
(minutes:seconds)
|
94:32
|
CBK_VTimeSec
|
Displays current
time (position) of
playing video file.
Time is displayed in
seconds.
|
48000
|
CBK_VTotalFrames
|
Returns number of frames
of playing video
file.
|
394024
|
CBK_VFrame
|
Displays current
frame (position) of
playing video file.
|
249253
|
Date & Time CBK
constants
CBK name
|
Explanation
|
Example
|
CBK_Year
|
Displays current
year.
|
2004
|
CBK_Month
|
Displays current year's
month using text
format.
|
July
|
CBK_Month
Num
|
Displays current year's
month using integer
(number) format in range
1 - 12.
|
7
|
CBK_Day
|
Displays day of current
week using text
format.
|
Tuesday
|
CBK_DayNum
|
Displays day of
current week using
integer (number)
format.
Range 1-7 represents
days:
-
Sunday = 1
-
Monday = 2
-
Tuesday = 3
-
Wednesday = 4
-
Thursday = 5
-
Friday = 6
-
Saturday = 7
|
3
|
CBK_DateNum
|
Displays current
month's day using
integer (number) format in
range
1 - 31.
|
22
|
CBK_DateShort
|
Displays current
date using short
Windows format
DD/MM/YY
(day:month:
year).
|
21/03/2002
|
CBK_DateLong
|
Displays current
date using long
Windows format Month
Day, YYYY
|
July 23, 2004
|
CBK_TimeHMS
|
Displays current system
time using
H:M:S
(hours:minutes:
seconds) format and
AM/PM time
division.
|
01:06:12 PM
|
CBK_Time24
|
Displays current system
time using
HH:MM:SS
(hours:minutes:
seconds), 24-hour
format.
|
13:06:12
|
CBK_Hour
|
Displays current
time hour in
range 0 -
23.
|
13
|
CBK_Minute
|
Displays current
time minute in
range 0 -
59.
|
06
|
CBK_Second
|
Displays current
time second in
range 0 -
59.
|
12
|
General CBK
constants
CBK name
|
Explanation
|
Example
|
CBK_PageName
|
Displays label of
currently opened
project
page.
|
Intro Page
|
|
Returns (eventual)
errors sent by FMOD
audio engine or Video
Object.
FMOD errors are
returned using integer
values.
See list
here.
|
180:00
|
CBK_Volume
|
Returns current master
volume in percentage
(0-100).
|
60
|
|
Displays current
URL from MMB's HTML
Object (if it's
available).
|
http://www.go.com
|
CBK_OpenFile
|
After using MMB's Open
File dialogbox, this CBK
displays selected file
name without path.
|
TurnAround.mpg
|
CBK_OpenDir
|
After using MMB's Open
File dialogbox, this CBK
displays path of selected
file.
|
c:\videos\
|
|
Run command sends return
values from the running
application (if return codes
were implemented in
application) to this CBK
object.
|
1
|
CBK_SelColor
|
Returns RGB value from MMB's
Color Picker dialogbox. Color
picking uses RGB
(Red,
Green,
Blue)
system containing 3
components.
Each component can have one
of 256 levels. Greater value
of component increases color
intensity. If you specify
value 0, color component will
not be used. Value 255 uses
maximum color
intensity.
Result of Color Picker is
a comma-separated array of
string values, each
representing one RGB
component (first: red,
second: green, third:
blue) in value range
0-255.
To retrieve color value,
simply assign contents of
CBK_SelColor to a string
variable:
color$=CBK_SelColor
|
|
Script CBK constants
CBK name
|
Explanation
|
Example
|
CBK_MP3EOF
|
If you set label of script
object either on current
project page or Master Top
Layer to match this CBK
constant, that script will
be launched when audio
file (mp3
and ogg) playback ends. MMB
will first look for this
script object on current
page and then on Master
Top Layer.
|
|
CBK_Menu
|
If you modify label of
object group to start
with CBK_Menu, that
group will be hidden
every time user clicks
outside that object
group.
This helps you in
making pop-up menus,
disappearing when user
clicks away. On user's
click on the screen,
all CBK_Menu labeled
objects will be hidden
except the menu under
mouse cursor.
For example check
masterpages.mbd
that comes in MMB
package.
|
|
CBK_EXIT
|
If you set label of object
either on Master Top Layer
to match this CBK
constant, pressing of
Escape key on keyboard
will not (by default)
close your
application.
Instead, script under
CBK_Exit labeled object
will be run, enabling you
to create "Do you want to
exit ?" message boxes or
whatever you want to do
when user wants to exit
application.
|
|
|
If you set label of Script
object
either on Master Page/Master
Top Layer
to match this CBK
constant, each time you start
your MMB application with some command
line parameters, this Script object
will be invoked and you will be able
to process the passed command line parameters
via this script object (e.g. start playback
of mp3 file passed by command line parameter
or process each of the passed parameters
individually).
|
|
System Constants
System info plays very important role
in adjustments of your project to work
on various end-user machines;
depending on retrieved info, your
project will be able to select most
suitable presentation for current
machine. In MMB, system constants hold
screen, window, processor and
memory info and these constants
are used as parameters for script
commands.
For example:
ScriptCommand(SystemConstant(),Param2)
Script command will use system
constant as it's first parameter. See
descriptions of real script commands
to find out which ones can accept this
kind of parameters.
ScreenWidth()
returns width of computer display in
pixels as an integer value
Script example:
Message("Display width is:
","ScreenWidth()")
ScreenHeight()
returns height of computer display in
pixels as an integer value
Script example:
Message("Display height is:
","ScreenHeight()")
WorkAreaWidth()
returns width of computer display work
area in pixels as an integer
value
Script example:
Message("Display work area width is:
","WorkAreaWidth()")
WorkAreaHeight()
returns height of computer display
work area in pixels as an integer
value
Script example:
Message("Display work area height is:
","WorkAreaHeight()")
MouseX()
returns X (horizontal) screen position
of mouse in pixels as an integer
value
Script example:
Message("Current mouse X position:
","MouseX()")
MouseY()
returns Y (vertical) screen position
of mouse in pixels as an integer
value
Script example:
Message("Current mouse Y position:
","MouseY()")
MouseLButton() MouseRButton() MouseMButton()
returns a
state of mouse buttons. If mouse button is pressed
then return value is 1
otherwise 0.
Script example:
To Page Start code insert ScriptTimer, which
will start a global MouseState detection script ScriptTimer("TimerA=Script","50")
Create
new script object called Script and insert the below
code into it:
MStateL=MouseLButton()
MStateM=MouseMButton()
MStateR=MouseRButton()
MState=MStateL+MStateM+MStateR
**
one button is clicked
If
(MState=1)
Then
If
(MStateR=1)
Then
LoadText("Text","RIGHT
CLICK IS DETECTED")
End
If
(MStateL=1)
Then
LoadText("Text","LEFT
CLICK IS DETECTED")
End
If
(MStateM=1)
Then
LoadText("Text","MIDDLE
CLICK IS DETECTED")
End
ScriptTimer("TimerA=click","50")
Return()
Else
**
none or more than one button is clicked
LoadText("Text","
")
End
**
restart mouse detection script
ScriptTimer("TimerA=click","50")
|
For more advanced example of mouse
state detection procedure check the
mousestatedetection.mbd
example project.
ProcType()
returns manufacturer, type and speed
of central processor unit (CPU) as
string (text) value
Script example:
var$=ProcType()
Message("CPU in this machine
is: ","var$")
|
Returned value will be for e.g:
Intel (R) Pentium (R) 4 CPU 2.40
GHz
ProcFreq()
returns speed of central processor
unit (CPU) in MHz as an integer
(number) value
Script example:
Message("CPU frequency in MHz:
","ProcFreq()")
|
Returned value will be for e.g:
2405
GetMemory()
returns quantity of Total and Free RAM
memory as string (text) values.
These values are separated
using slash /
character, so use MMB's
advanced string functions to
extract individual memory
values.
|
Script example:
Message("Machine memory
status:
","GetMemory()")
|
Returned value will be for e.g:
512/231
(first value represents Total
Memory, second Free
Memory)
UsingWinNT()
returns integer (number) value having
one of two available states:
1 = machine runs
WinNT-family operating
system
0 = machine doesn't
run WinNT-family operating
system
|
Script example:
Message("WinNT-compatible OS
present:
","UsingWinNT()")
|
If WinNT family OS is present,
returned value will be:
1
WinVer()
returns major, minor and build version
of running Windows as string (text)
value
These values are separated
with dot
.
so use MMB's advanced string
functions to extract
individual version
values.
|
Script example:
var$=WinVer()
Message("Windows version :
","var$")
|
Returned value will be for e.g:
5.01.2600
Windows have somewhat
standardized version
numbers. Here's a
list:
Windows
95
|
4.00.950
|
Windows 95
SP1
|
4.00.(>950)
/
4.00.(<=1080)
|
Windows 95
OSR2
|
4.(<10).(>1080)
|
Windows
98
|
4.10.1998
|
Windows 98 SP
1
|
4.10.(>1998)
/
4.10.(<2183)
|
Windows 98
SE
|
4.10.(>=2183)
|
Windows
Me
|
4.90.3000
|
Windows NT
3.51
|
3.51.1057
|
Windows NT
4.0
|
4.00.1381
|
Windows
2000
|
5.00.2195
|
Windows
XP/SP1
|
5.01.2600
|
|
ScreenColors()
returns number of colors currently
being used by Windows & graphics
card
Value returned is integer
(number) and represents
number of colors (16,256)
for lower modes or number
of bits (16, 32) for
higher graphic
modes.
|
Script example:
Message("Current graphics
color mode:
","ScreenColors()")
|
Returned value will be for e.g:
32
Publication Constants
This constants are related to
application window of your project.
You can retrieve various window sizes,
position and check if project window
is minimized.
PubWidth()
returns width of project's window in
pixels (with border) as
an integer value
Script example:
Message("Project window width + border
is:
","PubWidth()")
PubHeight()
returns height of project's window in
pixels (with border & title) as
an integer value
Script example:
Message("Project window height
+
border and title is:
","PubHeight()")
ClientWidth()
returns width of project's window
(workarea) in
pixels (without border) as an integer
value
Script example:
Message("Workarea
width is: ","ClientWidth()")
ClientHeight()
returns height of project's window (workarea)
in
pixels (with border & title) as an
integer value
Script example:
Message("Workarea
height:
","ClientHeight()")
PubX()
returns X (horizontal) position of
project's window in pixels as an
integer value
Script example:
Message("Project window X position:
","PubX()")
PubY()
returns Y (vertical) position of
project's window in pixels as an
integer value
Script example:
Message("Project window Y position:
","PubY()")
ObjectX(ObjectLabel)
returns X (horizontal) position of
specified object
Position retrieving starts from
upper-left corner of project's
window.
Returned position represents object's
upper-left corner.
Specifying of object you want position
for is done through label inside
parenthesis.
For example:
ObjectX(Button)
Script example:
Message("Current object X position:
","ObjectX(Button)")
Script line above will retrieve
upper-left corner X position of object
labeled "Button"
ObjectY(ObjectLabel)
returns Y (vertical) position of
specified object
Position retrieving starts from
upper-left corner of project's
window.
Returned position represents object's
upper-left corner.
Specifying of object you want position
for is done through label inside
parenthesis.
For example:
ObjectY(Button)
Script example:
Message("Current object Y position:
","ObjectY(Button)")
Script line above will retrieve
upper-left corner Y position of object
labeled "Button"
ObjectWidth(ObjectLabel)
returns width of specified object in
pixels
Width retrieving starts from object's
upper-left corner
Specifying of object you want width
for is done through label inside
parenthesis.
For example:
ObjectWidth(Button)
Script example:
Message("Button width is:
","ObjectWidth(Button)")
Script line above will retrieve width
of object labeled "Button"
ObjectHeight(ObjectLabel)
returns height of specified object in
pixels
Height retrieving starts from object's
upper-left corner
Specifying of object you want height
for is done through label inside
parenthesis.
For example:
ObjectHeight(Button)
Script example:
Message("Button height is:
","ObjectHeight(Button)")
Script line above will retrieve height
of object labeled "Button"
ImageScrollX(ObjectLabel)
returns X position
of left/top point of the image inside the Image object. This
is useful in case if image inside the Image object is
bigger/smaller than Image object itself and it's
scrollable inside the Image object ("Keep Actual
Image Size" option must be enabled).
ImageScrollX returns negative values if left/top corner of the image object
is out of the visible area of the Image object.
Script example:
Message("X
position of Bitmap is:
","ImageScrollX(Bitmap)")
Script line above will retrieve X
position of Left/Top corner of Bitmap.
ImageScrollY(ObjectLabel)
returns Y position
of left/top point of the image inside the Image object. This
is useful in case if image inside the Image object is
bigger/smaller than Image object itself and it's scrollable
inside the Image object ("Keep Actual Image Size"
option must be enabled).
ImageScrollY returns negative values if left/top corner of the image object
is out of the visible area of the Image object.
Script example:
Message("Y
position of Bitmap is:
","ImageScrollY(Bitmap)")
Script line above will retrieve Y position
of Left/Top corner of Bitmap.
ImageWidth(ObjectLabel)
returns full
width of image in
pixels.
While ObjectWidth returns width of the object,
ImageWidth returns width of entire Image, even if some
parts of Image are invisible (because image is bigger
than Image object).
Specifying of image
you want width
for is done through label inside
parenthesis.
For example:
ImageWidth(Bitmap)
Script example:
Message("Image
width is:
","ImageWidth(Bitmap)")
Script line above will retrieve width
of image labeled "Bitmap"
ImageHeight(ObjectLabel)
returns full
height of image in
pixels.
While ObjectHeight returns height of the
object, ImageHeight returns height of entire Image,
even if some parts of Image are invisible (because image
is bigger than Image object).
Specifying of image
you want height
for is done through label inside
parenthesis.
For example:
ImageHeight(Bitmap)
Script example:
Message("Image
height is:
","ImageHeight(Bitmap)")
Script line above will retrieve height
of image labeled "Bitmap"
GetVideoParam(ObjectLabel)
returns the current state (0/1 = OFF/ON)
of a given video parameter:
fullscreen
|
FullScreen mode is enabled
(1) or disabled (0)
|
loop
|
Loop is enabled (1) or disabled
(0)
|
mute
|
Sound is enabled (1) or
disabled (0)
|
time
|
Video is switched to Time
mode (1). 0 = Video is in frame
mode
|
frame
|
Video is switched to Frame
mode (1) 0 = Video is in time mode
|
Script example:
GetVideoState=GetVideoParam(Video,
fullscreen)
returns 0 or 1 according the current state of Video
screen
GetVideoState=GetVideoParam(Video,
mute) returns
0 or 1 if the audio Mute is disabled/enabled
ScrollBarSize(ObjectLabel)
returns width
(if ScrollBar is vertical) or height (if ScrollBar is
horizontal) of image ScrollBar in
pixels.
It's useful in cases when ScrollBar in Image
object is enabled and you want to know the size of Image
object including the ScrollBars. ScollBar size can
be different on various OS.
Script example:
Message("Image
ScrollBar height is:
","ScrollBarSize(Bitmap)")
Script line above will retrieve size
of ScrollBar from image object labeled "Bitmap"
IsVisible(ObjectLabel)
this constant will check if specified
object exists on current page and is
it visible or hidden
Integer value is returned, having one
of three available states:
-1 = object doesn't
exist on current page
0 = object is
hidden
1 = object is
visible
|
Specifying of object you want status
for is done through label inside
parenthesis.
Script example:
Message("Object status :
","IsVisible(Button)")
Example above will check if object
labeled "Button" exists and is it
visible or hidden.
If object doesn't exist, message box
will display "-1".
IsMinimized()
this constant will check if
application window of your project is
minimized
Integer value is returned, having one
of two available states:
1 = project window is
minimized
0 = project window is
not minimized
|
Script example:
Message("Project window status:
","IsMinimized()")
Path Macros
In MMB, there are fixed and dynamic
paths:
Fixed path: complete drive +
folder + file path that is static,
pointing to one location.
For example:
c:\My Wonderful
Project\App\MyApp.exe
Fixed path downside is
zero-adjustability of source folder by
your end-user; he can't select where
application will be installed, and
that's not professional approach to
end-users these days.
Dynamic path: in MMB path
macros are being used to make easier
locating of frequently used folders.
While path macros read current path to
your application, using them you
assure end-user adjustability of
installation folder.
Path macros in MMB are string (text)
values and you will use them as a
script command parameters. For
example:
ScriptCommand("Param1","<ProjectFolder>\MyApp.exe")
Example above uses path macro called
<ProjectFolder>\ to retrieve
folder where your application is
located. After path macro you write
full file name (in this case:
MyApp.exe).
Besides those available in MMB, there
are additional path macros available
in MMB PlugIns; refer to their
documentation for more info on this
subject.
Now, let's see what path macros we can
use directly in MMB:
<SrcDir>
The most often used path macro,
represents folder where your (running)
application is located.
While other project files are usually
also located there (or in subfolders),
Source Directory (SrcDir) macro
becomes common part of file-oriented
commands in your project.
If complete path to your application
is:
c:\Program Files\My Project
Folder\MyApp.exe
...then <SrcDir> version of this
path would be:
<SrcDir>\MyApp.exe
It's much easier that way, isn't it ?
For every file path inside your
project's folder you will substitute
fixed path with dynamic version and
enjoy all benefits of self-adjusting
paths !
Inside MMB script command, this path
macro would look like this:
ScriptCommand("Param1","<SrcDir>\MyApp.exe")
Example above instructs script command
to use <SrcDir>\ inside second
parameter and locate application's
source directory before looking for
file (MyApp.exe).
Once MMB translates this path macro,
it's again full path (for e.g.
c:\Program Files\My Project\MyApp.exe)
and script command can be
run.
Notice: MMB runs project files
in two modes:
-
Design Mode - while
editing your project in MMB,
using Project -> Run option
will execute project
internally, where
<SrcDir> becomes MMB's
installation folder (for
example c:\Program
Files\Multimedia Builder) and
all files you refer to using
<SrcDir> should be
placed there.
This mode is enabled when
Tools -> Designer
Settings is set to
internal
player:
-
RunTime Mode - executes
project either after compiling
(File -> Compile) as
stand-alone EXE file, or
when Tools -> Designer
Settings is set to specified
external player:
What is "external player" ? It's
an instance of compiled (EXE) file
placed in some folder (for e.g.
D:\Source\Autorun.exe ). Once you
refer to it in
Tools -> Designer
Settings
(for e.g. D:\Source),
<SrcDir> for projects you
run in MMB editor becomes source
folder
of external player
and all files you refer to using
<SrcDir> should be placed
there.
<SrcDrive>
Represents root folder of (source)
drive your application is running
on.
If your application is located on C
drive, <SrcDrive> path macro
will return:
c:\
This macro is suitable for
ROM-oriented media projects (run from
CD-ROMs, DVDs) that must reach data
folders starting from the root folder
of media.
<CD>
Returns root folder of the first
available CD drive.
If first available CD drive is placed
on E letter, <CD> path macro
will return:
E:\
This macro is also suitable for
ROM-oriented media projects (run from
CD-ROMs, DVDs) that must reach data
folders starting from the root folder
of media. Also works well for
multimedia players for locating
default Audio CD / DVD drive. Downside
of this macro is - it cannot enumerate
all drives, but only the first
one.
<Embedded>
Returns folder used by your
application for placing of
embedded files.
As you can see on images above,
locations of embedded folders are
Window's folders for temporary files
and they differ on Windows OS
families.
For example. If you have
embedded sound file:
MySound.wav
It's location with path macro will
be:
<Embedded>\MySound.wav
When you run application, MMB will
translate that path (for itself)
either to:
c:\Windows\Temp\MMBPlayer\MySound.wav
(for Windows 9x OS family)
...or to something like:
c:\Documents and
Settings\UserName\Local
Settings\Temp\MMBPlayer\MySound.wav
(for Windows NT OS family, where
folders for temporary files are
individual for users)
<Windows>
Returns Windows root folder.
For example, if Windows is installed
on the C drive and you want to find
win.ini file, location with path macro
will look like this:
<Windows>\win.ini
When you run application, MMB will
translate that path (for itself)
to:
C:\Windows\win.ini
In MMB, <Windows> path macro is
usually called to locate system INI
files.
<System>
Returns Windows System folder.
If you're trying to locate
program:
dxdiag.exe
It's location with path macro will
be:
<System>\dxdiag.exe
When you run application, MMB will
translate that path (for itself)
either to:
c:\Windows\System\dxdiag.exe
(for Windows 9x OS family)
...or to something like:
c:\Windows\System32\dxdiag.exe
(for Windows NT OS family)
<Temp>
Returns Windows Temp folder used for
placing of Windows temporary
files.
If you have some temporary
file:
TempList.txt
It's location with path macro will
be:
<Temp>\TempList.txt
When you run application, MMB will
translate that path (for itself)
either to:
c:\Windows\Temp\TempList.txt
(for Windows 9x OS family)
...or to something like:
c:\Documents and
Settings\UserName\Local
Settings\Temp\TempList.txt
(for Windows NT OS family, where
folders for temporary files are
individual for users)
<File>
Returns full path & name of file
opened using MMB's Open File
dialogbox.
If you open file:
c:\windows\regedit.exe
that path can be retrieved later by
simply pointing to:
<File>
Content of this path macro is changed
every time user selects & opens
file, so it's recommended to use
string variables or arrays for
multiple path storage.
<List>
Enables operations specific to MMB's
internal play list and ListBox
object.
<List> constant holds items
present in MMB's Internal Song List,
so you can easily transfer all it's
items to MMB's ListBox Object.
Script example:
ListBoxAddItem("SongList","<List>")
In real-code example above,
content of <List> will be
transfered to ListBox object
labeled "SongList" . For more info
on ListBoxAddItem command, refer
to ListBox Commands
section.
<This>
<This> is a special macro useful only in
MCI command. It will tell the device the MMB window will be the parent.
Here is
a small sample how to play MPG movie inside the mbd project in the position
(100,50,100,100):
MCICommand ("open <SrcDir>\sample.mpg alias MPEG style child parent
<This>") MCICommand ("put MPEG window at 100
50 200 200") MCICommand ("window MPEG state hide") MCICommand ("play MPEG") |